function theta2 = setTheta2_threshold_macro(h0_1,h0_2,hx_1,hx_2,sigmax,gama0,gamaz,gamax,sigmaz)
nx = size(hx_1,1);
% regime 1
for i=1:nx
    name = ['h0',num2str(i),'_1'];
    theta2.(name) = h0_1(i,1);
end
for i=1:nx
    for j=1:nx
        name = ['hx',num2str(i),num2str(j),'_1'];
        theta2.(name) = hx_1(i,j);
    end
end
% regime 2
for i=1:nx
    name = ['h0',num2str(i),'_2'];
    theta2.(name) = h0_2(i,1);
end
for i=1:nx
    for j=1:nx
        name = ['hx',num2str(i),num2str(j),'_2'];
        theta2.(name) = hx_2(i,j);
    end
end
% Conditional co-variances
for i=1:nx
    for j=1:i
        name = ['sigma',num2str(i),num2str(j)];
        theta2.(name) = sigmax(i,j);
    end
end
% Process for z
theta2.gama0      = gama0;
theta2.gamaz      = gamaz;
for i=1:nx
    name = ['gamax',num2str(i)];
    theta2.(name) = gamax(i,1);
end
theta2.sigmaz     = sigmaz;

end